/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
/**
 * \file
 * \brief Header for MaCI error type handling.
 * \author Antti Maula <antti.maula@tkk.fi>
 *
 * $Id: MaCIError.hpp,v 1.5 2009-04-28 08:38:14 amaula Exp $
 *
 */
#ifndef _MACI_INTERFACES_MACIERROR_HPP_
#define _MACI_INTERFACES_MACIERROR_HPP_
#include <string>

namespace MaCI {
  /**
   * Enumeration types for return values.
   */
  enum EMaCIError { 
    KMaCIOK                 = 0,    ///< All ok.
    KMaCIError              = -1,   ///< General error, no exact reason available
    KMaCITimeout            = -2,   ///< Operation timed out
    KMaCIUnknownClient      = -3,   ///< Unknown source/target client specified
    KMaCINoConnection       = -4,   ///< No GIMnet connection avaiable, operation cannot be completed.
    KMaCIInvalidFormat      = -5,   ///< Decoding/Encoding resulted in failure.
    KMaCINotActive          = -6,   ///< Operation failed because backend wasn't available.
    KMaCIAccessDenied       = -7,   ///< Access was denied.
    KMaCIInvalidParam       = -8,   ///< Call failed due to invalid parameters.
    KMaCIUnimplemented      = -10,  ///< Requested feature is not (yet?) implemented
    KMaCIUnknownError       = -100, ///< Unknown error. This should never be returned to user!
  }; 
  

  /** Return errorcode description.
   *
   * This function returns a textual representation of the given
   * errorcode.  This function is global to 'MaCI' namespace.
   * 
   * @param[in] error         Error code to convert to verbose form
   * @return                  std::string containing the verbose form
   *                          of the error.
   */
  std::string GetErrorStr(const EMaCIError error);

}
#endif

